var gulp = require('gulp');
var util = require('gulp-util');
var GulpWebpack = require('gulp-webpack');
var webpack = require('webpack');
var webpackDevServer = require('webpack-dev-server');
var webpackConfig = require('./webpack.config');

var devPath = __dirname+'/app/src_dev';
var param = util.env;

gulp.task('server',function(){
	var port = param.port||8088;
	var compiler = webpack(webpackConfig);

	new webpackDevServer(compiler,{
		contentBase:'./app',
		hot: true,
		headers: { 'Access-Control-Allow-Origin': '*' },
		publicPath:'/assets/'

	}).listen(port,function(err){
		util.log('listening: http://localhost:'+port);
	})

})


